package edu.cmu.aes.project2.ws.supplier;

import java.util.ArrayList;

import javax.jws.WebMethod;
import javax.jws.WebService;

import edu.cmu.aes.project2.wshelper.BikeInfo;
import edu.cmu.aes.project2.wshelper.Order;
import edu.cmu.aes.project2.wshelper.XMLProcessing;

@WebService()
public class SupplierService {

	@WebMethod()
	public ArrayList<String> getBrands(){
		XMLProcessing xml = new XMLProcessing();
		return xml.getBrands();
	}
	
	@WebMethod()
	public ArrayList<String> getModels( String brand){
		XMLProcessing xml = new XMLProcessing();
		return xml.getModels(brand);
	}
	 
	@WebMethod()
	public BikeInfo getDetails(String model){
		XMLProcessing xml = new XMLProcessing();
		return xml.getDetails(model);
	}
	
	@WebMethod()
	public boolean placeOrder(Order order){
		System.out.println("Place order is called");
		XMLProcessing xml = new XMLProcessing();
		return xml.placeOrder(order);
	}
	
	@WebMethod()
	public boolean placeOrderRollBack(Order order){
		XMLProcessing xml = new XMLProcessing();
		return xml.placeOrderRollback(order);
	}
}
